package com.uam.core.entity.constant;

import com.uam.core.lk.utils.ErrorInterface;

/**
 * 2001000  20 项目名称，00：公共模块 01：代表地址围栏，02 轨迹， 000 自定义模块错误
 * 功能描述  错误接口定义
 * @Date  2019/10/29 17:37
 * @author heguanglnog
 */
public enum UamErrorCode implements ErrorInterface {
    EMPTY_DATA(2000000, "没有数据"),
    PARAM_IS_NULL(3, "缺少必要参数"),

    /**全局错误吗*/
    SUCCESS(0, "请求成功"),
    INTERNAL_SERVER_ERROR(1, "服务器内部错误"),
    PARAM_ERROR(2, "请求参数非法"),
    AUTHENTICATE_FAIL(4, "认证失败"),
    INTERFACE_PERMISSION_DENY(5, "没有该接口访问权限"),
    REQUEST_METHOD_NOT_SUPPORT(6, "请求方式不支持"),
    UNKNOWN_ERROR(7, "其他未知错误"),
    REQUEST_PATH_ERROR(8, "请求路径错误"),
    REQUEST_TIMEOUT(9, "请求超时"),
    SYN_ERROR(2000002, "并发异常"),
    BUSY(500, "服务器开小差了~"),

    PARAM_EMPTY(200003, "参数为空"),

    NO_LOGIN_FAILED(20000,"未登陆！"),
    /**本项目公共模块错误*/
    FAILED(2000001, "操作失败"),
    SERVER_NO_EXITS(2000003,"服务不存在！"),
    ILLEGAL_ACCESS_RESOURSE(2000005, "资源非法访问"),
    RESOURSE_NOT_FOUND(2000006, "没有找到资源"),
    AK_AND_TOKEN_ERROR(2000007, "ak或accessToken只能传一个参数"),
    AK_USER_TOKEN_ERROR(2000017, "根据AK获取用户id错误"),
    NO_SESSION(2000009, "账号登录超时，为保证信息安全，请重新登录"),
    NO_AOP_ERROR(2000010,"获取AOP日志类型错误"),
    USER_ALLOW_NOT_FOUND(2000011,"用户信息校验错误"),
    USER_ID_NOT_NULL_ERROR(2000012,"用户id不能为空！"),
    SERVER_ID_NOT_NULL_ERROR(2000013,"服务ID无效！"),
    REQUEST_DATA_MAX(2000015, "请求数量超超限"),
    REQUEST_MORE_OPERATION(2000016, "重复操作"),
    CONFIGURE_INFO_NOT_EXIT(2000018, "配置信息不存在"),
    SERVER_TERM_NUM(2000019,"服务的终端数量已达上限"),
    PROPERTY_NUM_MAX(2000020,"服务属性数量已达上限"),
    SERVER_NUM_MAX(2000021,"用户创建的服务数量已经达到上限!"),
    NO_DATA(2000022, "无数据"),
    SERVER_CHECK_ERROR(2000023,"数据验证错误"),

    /**围栏模块错误码*/
    FENCE_ALLOW_MAX(2001002,"围栏数量已达上限，请联系客服购买"),
    SERVER_FENCE_ERROR(2001003,"单个服务的围栏数量已达上限，请联系客服购买"),
    EMG_LAYER_SEARCH_TYPE_ERROR(2001004,"按照类型搜索易图通错误"),
    ALARM_TYPE_ERROR(2001006,"告警类型错误"),
    FENCE_RATE_CHECK_IN_ERROR(2001008,"实时围栏信息验证错误，没有找到对应的类型"),
    CHECK_USER_ID_ERROR(2001009,"获取用户信息错误！"),
    ;

    private Integer errorCode;
    private String errorMessage;

    private UamErrorCode(Integer errorCode, String errorMessage) {
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }


    @Override
    public int getErrorCode() {
        return errorCode;
    }


    @Override
    public String getErrorMessage() {
        return errorMessage;
    }
}
